Skip to content

difftest(primitive.primitive_creation_p2): gen0092 and gen0189 recorded, the exact net's small elbow is an invalid body - #2811

Merged
bherbruck merged 6 commits into
tangency-labs:mainfrom
ablasik:difftest/primitive-creation-p2-exact-sweep
Nov 6, 2026
Merged

bherbruck merged 6 commits into
tangency-labs:mainfrom
ablasik:difftest/primitive-creation-p2-exact-sweep

Conversation

@ablasik

@ablasik ablasik commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Records the two small-profile elbow cases of primitive.primitive_creation_p2 as known failing on the goldens layout, and adds a regression for the radius where the elbow is a valid body.

Cases gen0092 and gen0189 (the same input: a circle of radius 1e-3 swept along two lines of length 1e-2 at a right angle, tolerance 1e-7, both caps) changed with #2740, which builds a path sweep's net from its definition. Before #2740, both sides refused (boolean::merge::p3, code 1001). Now solidcore returns success, but the body fails check_brep level 2: SmVertex::Test tangency-labs/solidcore#1 Bad Vertex Gap, vertex offset 1.8284271e-3 = r(2 sqrt 2 - 1) against a tolerance of 2e-5. From radius 0.1 the elbow is a valid body of volume pi r^2 (leg1 + leg2); at 1e-2 and below it is not. The leg length does not matter, the radius does. The finding in plan/findings/ has the measured table.

These results are wrong, so they are not blessed. #2816 carried them over as goldens with the wrong values (status 0, a body returned); this PR removes those two golden lines and lists both cases in crates/goldens/expected/known_failing.json under tangency-labs/solidcraft#13762. The correct answer is either a refusal or the valid body of volume 6.2832e-8. The fix is in the draft #2840 (projected extrema used by small-profile mitres), which removes the entries and blesses the correct results with its pictures.

Changes:

  • crates/goldens/expected/known_failing.json: gen0092 and gen0189.
  • crates/goldens/expected/primitive.primitive_creation_p2.jsonl: the two wrong golden lines removed.
  • crates/solidcore/tests/issue_2794_planar_path_mitred_elbow.rs: the elbow at radius 0.1 is a valid body of the closed-form volume.
  • plan/findings/primitive.primitive_creation_p2--exact-net-elbow-unites-into-an-invalid-body-below-radius-0-1.md: the measurements.

No kernel code changes and no tolerance changes. Refs tangency-labs/solidcraft#13762.

@bherbruck @jyviko

Summary by CodeRabbit

  • Known Issues
    • Very small circular profiles swept along a right-angle path may produce an invalid body even when the operation reports success.
  • Tests
    • Added regression coverage for right-angle sweeps, including checks of body validity and volume.

…ed, the exact net's elbow is an invalid body below radius 0.1
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR documents two small-radius planar-path elbow cases that return invalid bodies, marks them as known-failing, and removes their expected golden records. It also adds a regression test for B-rep validity and volume at radius 0.1.

Changes: Planar-path elbow

Layer / File(s) Summary
Record small-radius elbow results
plan/findings/primitive.primitive_creation_p2--exact-net-elbow-unites-into-an-invalid-body-below-radius-0-1.md, crates/goldens/expected/known_failing.json, crates/goldens/expected/primitive.primitive_creation_p2.jsonl
The report describes invalid B-rep results for two small-radius cases. The known-failing fixture records both cases, and their expected golden records are removed.
Test elbow validity and volume
crates/solidcore/tests/issue_2794_planar_path_mitred_elbow.rs
The test builds a circular-profile sweep along two perpendicular segments. It checks B-rep validity and compares the volume with the expected value at radius 0.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

  • Issue 2794 asks for a fix or measured findings for two failing primitive.primitive_creation_p2 cases. This PR documents the cases and their observed results.

Possibly related PRs

  • tangency-labs/solidcore#2840: Changes the projected-extrema solver for mitre trimming and adds validity and volume regressions for the small-profile elbows documented here.

Suggested reviewers: brett19, jyviko

Merge Risk: Minimal · up to 55f35

The existing small-radius failures are tracked, not fixed. No merge-blocking risk was identified.

Architecture risk: Low · up to 55f35

The change affects 2 systems.

Changed systems: crates, plan

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 3 changed files map to changed impact.
  • observed — plan (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/solidcore/tests/issue_2794_planar_path_mitred_elbow.rs: Adds issue and test-context documentation, allows Clippy unwrap and indexing lints, and imports the geometry, sweep, validation, and volume APIs used by the test.
  • observed — Modified behavior in crates/solidcore/tests/issue_2794_planar_path_mitred_elbow.rs: Adds elbow, which creates a quadratic circular profile, defines two joined perpendicular line segments, builds a planar-path sweep with the supplied tolerance and three enabled options, extracts its B-rep, and refreshes cached topology.
  • observed — Modified behavior in crates/solidcore/tests/issue_2794_planar_path_mitred_elbow.rs: Adds a test using radius 1e-1, leg length 1., and sweep tolerance 1e-7. It asserts Level2 B-rep validity and checks the volume against π × radius² × 2 × leg with an absolute-error limit of exact × 1e-4.
  • observed — Modified behavior in crates/goldens/expected/primitive.primitive_creation_p2.jsonl: Removed the expected record for gen0092, whose record values ended with 1.0.
Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title identifies the two recorded cases and the invalid small-elbow body.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 965d862 and 55f35cf.

Files selected for processing: 1

  • crates/goldens/expected/known_failing.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@ChrisNourse

Copy link
Copy Markdown
Contributor

Taking the explicitly available small-profile mitre follow-up in draft #2840: reproduce the invalid small-radius elbow and fix its geometric cause. #2811 retains ownership of its mismatch records and existing test; #2840 owns the library fix and failing-radius regressions. Initial scope is the planar-path mitre construction and whichever routine the first incorrect geometry traces to. No tolerance relaxation or passing validation is claimed.

@tdamsma

tdamsma commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Integration finding at bb92a6775: plan/units/primitive.primitive_creation_p2.toml still says status = "green", so the two new ordinary mismatches make the native command fail its selection gate. Please include the truthful partial plan status in this PR, preserving its history/notes; no case or tolerance change is needed.

I merged only the published heads of #2792, #2803, #2806 and #2811 onto main 3f82278a1 in an unpublished branch (18aa8caac), using private Cargo target/build directories and the pinned native libraries. Repro:

cargo run --profile difftest -p difftest --features cpp -- --unit primitive.primitive_creation_p2
PARTIAL primitive.primitive_creation_p2 cases=374 passed=352 failed=0 deferred=0 max_rel_err=1e0 with_values=352 no_values=0 vacuous=0 rejected=20 known_mismatch=2
FAIL primitive.primitive_creation_p2: plan status is green but cases are deferred or known mismatches

Exit 1. This is a plan-status blocker, separate from #2840’s claimed geometry fix. I have not edited either scope or published the integration branch.

@jyviko

jyviko commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks @ablasik, careful work: the radius table shows it's the small-profile mitre, not the legs. Please mark the unit partial as tdamsma noted, then this can merge as the record. One thing beyond it: the result is a body that fails check_brep level 2 (a vertex 1.8e-3 off its faces), and a wrong body must be refused, never returned. So #2840 is urgent. Until the mitre is fixed, the sweep should refuse below the radius where the union stays valid, naming that radius.

@ablasik

ablasik commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@ChrisNourse @jyviko asked above that, until the small-profile mitre is fixed, the planar-path sweep refuse below the radius where the union stays valid (naming that radius), instead of returning a body that fails check_brep level 2. That guard sits in the code #2840 already owns. Would you like to add it in #2840, or should we open a small separate PR with only the refusal, which #2840 removes once the mitre is right? cc @bherbruck

@jyviko

jyviko commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this! #2816 has merged and replaced difftest with goldens. To land, this PR needs the steps in this comment. Its known_mismatches entries for primitive.primitive_creation_p2 (gen0092, gen0189) go away: bless the cases your change moves in crates/goldens/expected/, each with its old and new values and why the new ones are right. A result that is still wrong goes in known_failing.json with its issue.

ablasik and others added 3 commits November 6, 2026 13:30
… went with difftest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bherbruck bherbruck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ablasik. Rebased onto goldens by me: the two cases are recorded in known_failing.json with their issue, and the radius-0.1 regression stays. The refusal jyviko asked for belongs with #2840. Merging.

Written by Claude Code (Anthropic) on behalf of @bherbruck.

@bherbruck
bherbruck merged commit 6bafedd into tangency-labs:main Nov 6, 2026
11 of 12 checks passed
ChrisNourse added a commit to ChrisNourse/solidcore that referenced this pull request Nov 7, 2026
Record 201 justified outputs (190 changed and 11 added), with case-level old/new
values in the golden diffs and geometric justification in the consolidated finding.
No comparison tolerance or absolute floor changes.

Examples: curve_p4/circle_property_21's derivative changes +0.64309503671411716
to -0.64309503671411716; intersect.topology_solver_p1/gen1646 changes refusal
to three successful calls with an enclosure-rounded near-zero distance at
parameter 0.6406108473689741; topology.brep_p1/find_side_6 changes 1001/UNSURE
to success/left, justified by the positive endpoint tangent cross product.
The missed-box trims retain the full box (26/48/24 or 6/12/8 faces/edges/vertices)
because the nearest cutter endpoint and positive side inequality apply throughout.
The raw-knot lens keeps one face for KeepPoint and zero for DeletePoint because
both boundaries are entirely on the reference side. Existing before/after figures
show the actual elbow geometry and the conditioning cases.

Exclude six disproved curve-pair maxima under #3060, four unverified finite-cutter
trim outputs under #3061, and the sphere-band accuracy failure under #2967.
The finding separates proved defects from missing expected-result contracts.
Existing #2794 records remain with tangency-labs#2811's owner.

Co-Authored-By: Codex <noreply@openai.com>
@ablasik
ablasik deleted the difftest/primitive-creation-p2-exact-sweep branch November 7, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants